//index.js
//获取应用实例
const app = getApp()
const jeegot = require('../../utils/jeegot.js')

Page({
  data: {
    indexData: {}
  },
  onLoad: function () { 
    jeegot.getIndexData().then(data=> {
      this.setData({
        indexData:data
      })
    })
  },
  toSearch: function () {
    wx.navigateTo({
      url: '/pages/search/search'
    });
  },
  handleClick: function (e) {
    let data = e.currentTarget.dataset.value;
    // 商品
    wx.navigateTo({
      url: '/pages/product/product?id=' + data.id
    });
  },
  clickHeader: function (e) {
    let data = e.currentTarget.dataset.value;
    wx.navigateTo({
      url: '/pages/category/category?id=' + data.id
    });
  }
})